package com.pug.ksd.filter;

import com.google.common.hash.BloomFilter;
import com.google.common.hash.Funnels;

/**
 * Author: lqm
 * create: 2022/5/15 13:20
 * Lover: lqx
 *
 * @see
 */
public class Test {
    public static void main(String[] args) {
        //我们创建了一个最多存放 最多 1500 个整数的布隆过滤器，并且我们可以容忍误判的概率为百分之（0.01）
        BloomFilter<Integer> filter=BloomFilter.create(Funnels.integerFunnel(),1500,0.01);
        boolean b = filter.mightContain(1);
        filter.put(1);
        boolean b1 = filter.mightContain(1);
    }
}
